﻿@model PresentationMVC.Models.JobBookingModel
@{
    ViewBag.Title = "CreateJob";
}

@using (Html.BeginForm("Save", "Job"))
{
    <table>
        <tr>
            <td class="editor-label">
                @Html.LabelFor(m => m.JobBooking.Customer)
            </td>
            <td class="editor-field">
                @Html.DropDownListFor(m => m.SelectedCustomerId, new SelectList(Model.Customers, "ID", "FirstName", Model.JobBooking.Customer))
            </td>
            <td class="editor-label">
                @Html.LabelFor(m => m.JobBooking.Staff)
            </td>
            <td class="editor-field">
                @Html.DropDownListFor(m => m.SelectedStaffId, new SelectList(Model.Staffs, "ID", "FirstName", Model.JobBooking.Staff))
            </td>
        </tr>
        <tr>
            <td class="editor-label">
                @Html.LabelFor(m => m.JobBooking.BookingType)
            </td>
            <td class="editor-field">
                @Html.DropDownListFor(m => m.JobBooking.BookingType.ID, new SelectList(Model.BookingTypes, "ID", "Type", Model.JobBooking.BookingType))
            </td>
            <td class="editor-label">
                @Html.LabelFor(m => m.JobBooking.Status)
            </td>
            <td class="editor-label" style="vertical-align: middle;">
                @Html.DropDownListFor(m => m.JobBooking.Status.ID, new SelectList(Model.Statuses, "ID", "Type", Model.JobBooking.Status))
            </td>
        </tr>
        <tr>
            <td class="editor-label">
                @Html.LabelFor(m => m.JobBooking.JobDateTime)
            </td>
            <td class="editor-label" style="vertical-align: middle;">@Html.TextBoxFor(m => m.JobBooking.JobDateTime, new { @class = "datepicker" })<br />
                @Html.ValidationMessageFor(m => m.JobBooking.JobDateTime)
            </td>
            <td>
            </td>
            <td>
            </td>
        </tr>
        <tr>
            <td class="editor-label">
                @Html.LabelFor(m => m.JobBooking.FromAddressLine1)
            </td>
            <td class="editor-label" style="vertical-align: middle;">@Html.TextBoxFor(m => m.JobBooking.FromAddressLine1)<br />
                @Html.ValidationMessageFor(m => m.JobBooking.FromAddressLine1)
            </td>
            <td class="editor-label">
                @Html.LabelFor(m => m.JobBooking.FromAddressLine2)
            </td>
            <td class="editor-label" style="vertical-align: middle;">@Html.TextBoxFor(m => m.JobBooking.FromAddressLine2)<br />
                @Html.ValidationMessageFor(m => m.JobBooking.FromAddressLine2)
            </td>
        </tr>
        <tr>
            <td class="editor-label">
                @Html.LabelFor(m => m.JobBooking.FromCounty)
            </td>
            <td class="editor-label" style="vertical-align: middle;">@Html.TextBoxFor(m => m.JobBooking.FromCounty)<br />
                @Html.ValidationMessageFor(m => m.JobBooking.FromCounty)
            </td>
            <td class="editor-label">
                @Html.LabelFor(m => m.JobBooking.FromCity)
            </td>
            <td class="editor-label" style="vertical-align: middle;">@Html.TextBoxFor(m => m.JobBooking.FromCity)<br />
                @Html.ValidationMessageFor(m => m.JobBooking.FromCity)
            </td>
        </tr>
        <tr>
            <td class="editor-label">
                @Html.LabelFor(m => m.JobBooking.FromPostcode)
            </td>
            <td class="editor-label" style="vertical-align: middle;">@Html.TextBoxFor(m => m.JobBooking.FromPostcode)<br />
                @Html.ValidationMessageFor(m => m.JobBooking.FromPostcode)
            </td>
            <td class="editor-label">
                @Html.LabelFor(m => m.JobBooking.FromCountry)
            </td>
            <td class="editor-label">
                @Html.DropDownListFor(m => m.JobBooking.FromCountry.ID, new SelectList(Model.AllCountry, "ID", "Name", Model.JobBooking.FromCountry))
            </td>
        </tr>
        <tr>
            <td class="editor-label">
                @Html.LabelFor(m => m.JobBooking.ToAddressLine1)
            </td>
            <td class="editor-label" style="vertical-align: middle;">@Html.TextBoxFor(m => m.JobBooking.ToAddressLine1)<br />
                @Html.ValidationMessageFor(m => m.JobBooking.ToAddressLine1)
            </td>
            <td class="editor-label">
                @Html.LabelFor(m => m.JobBooking.ToAddressLine2)
            </td>
            <td class="editor-label" style="vertical-align: middle;">@Html.TextBoxFor(m => m.JobBooking.ToAddressLine2)<br />
                @Html.ValidationMessageFor(m => m.JobBooking.ToAddressLine2)
            </td>
        </tr>
        <tr>
            <td class="editor-label">
                @Html.LabelFor(m => m.JobBooking.ToCounty)
            </td>
            <td class="editor-label" style="vertical-align: middle;">@Html.TextBoxFor(m => m.JobBooking.ToCounty)<br />
                @Html.ValidationMessageFor(m => m.JobBooking.ToCounty)
            </td>
            <td class="editor-label">
                @Html.LabelFor(m => m.JobBooking.ToCity)
            </td>
            <td class="editor-label" style="vertical-align: middle;">@Html.TextBoxFor(m => m.JobBooking.ToCity)<br />
                @Html.ValidationMessageFor(m => m.JobBooking.ToCity)
            </td>
        </tr>
        <tr>
            <td class="editor-label">
                @Html.LabelFor(m => m.JobBooking.ToPostcode)
            </td>
            <td class="editor-label" style="vertical-align: middle;">@Html.TextBoxFor(m => m.JobBooking.ToPostcode)<br />
                @Html.ValidationMessageFor(m => m.JobBooking.ToPostcode)
            </td>
            <td class="editor-label">
                @Html.LabelFor(m => m.JobBooking.ToCountry)
            </td>
            <td class="editor-label">
                @Html.DropDownListFor(m => m.JobBooking.ToCountry.ID, new SelectList(Model.AllCountry, "ID", "Name", Model.JobBooking.ToCountry))
            </td>
        </tr>
        <tr>
            <td class="editor-label">
                @Html.LabelFor(m => m.JobBooking.WaitingCharge)
            </td>
            <td class="editor-label" style="vertical-align: middle;">@Html.TextBoxFor(m => m.JobBooking.WaitingCharge)<br />
                @Html.ValidationMessageFor(m => m.JobBooking.WaitingCharge)
            </td>
            <td class="editor-label">
                @Html.LabelFor(m => m.JobBooking.Fare)
            </td>
            <td class="editor-label" style="vertical-align: middle;">@Html.TextBoxFor(m => m.JobBooking.Fare)<br />
                @Html.ValidationMessageFor(m => m.JobBooking.Fare)
            </td>
        </tr>
        <tr>
            <td class="editor-label">
                @Html.LabelFor(m => m.JobBooking.Note)
            </td>
            <td class="editor-label" style="vertical-align: middle;">@Html.TextBoxFor(m => m.JobBooking.Note)<br />
                @Html.ValidationMessageFor(m => m.JobBooking.Note)
            </td>
            <td class="editor-label">
                @Html.LabelFor(m => m.JobBooking.Refund)
            </td>
            <td class="editor-label" style="vertical-align: middle;">@Html.TextBoxFor(m => m.JobBooking.Refund.RefundAmount)<br />
                @Html.ValidationMessageFor(m => m.JobBooking.Refund.RefundAmount)
            </td>
        </tr>
    </table>
    @Html.HiddenFor(m => m.JobBooking.ID)
    @Html.Partial("PassengerDetails");
    
    @Html.Partial("CarParkingDetails");
                                       
                                       
    <p>
        <input type="submit" value="Save" />
       @Html.ActionLink(" ", "Index", "Job", new Object() { }, new { @class = "clear-but" })
         <a href="/Job/ViewJobs">View</a>

    </p>
}